(function(){
	function $$(parentDom,elem){
		return parentDom.querySelectorAll(elem);
	};
    let aTabSelector = $$(document,'.tab-selector');
    let aInput1 = $$(aTabSelector[0] ,'input')
    let aTab1 = $$(aTabSelector[0] ,'.noticeTab .content')
    let aInput2 = $$(aTabSelector[1] ,'input')
    let aTab2 = $$(aTabSelector[1] ,'.noticeTab .content')
	function changeTab(index,selectInput,tabContent){
		/* 把每一个都遍历为none */
		for(let i = 0,len = selectInput.length; i < len; i++){
			selectInput[i].className = ""
			tabContent[i].style.display = 'none'
		}
		/* 给选中的加上css样式 */
		selectInput[index].className = 'on'
		tabContent[index].style.display = 'block'
	}
	for(let i = 0,len=aInput1.length; i < len; i++){
		// 需要传参的es6写法
        aInput1[i].addEventListener("mouseover",
        function(){changeTab(i,aInput1,aTab1)},false)
    }
    for(let i = 0,len=aInput2.length; i < len; i++){
		// 需要传参的es6写法
        aInput2[i].addEventListener("mouseover",
        function(){changeTab(i,aInput2,aTab2)},false)

	}
})()